﻿#include <iostream>

#include "WindowsHardWareInfo.h"

int main()
{
    WindowsHardWareInfo hard_ware;

    BISOInfoStruct ds;
    hard_ware.GetBIOSAllInfo(ds);

    ProcessorInfoStruct p;
    hard_ware.GetProcessorAllInfo(p);

    BaseBoardInfoStruct p1;
    hard_ware.GetBaseBoardAllInfo(p1);

    DiskDriveInfoStruct p2;
    hard_ware.GetDiskDriveAllInfo(p2);

    std::string res;

    // 主板信息
    std::cout << "-----------------------------------------------------" << std::endl;
    
    if (hard_ware.GetBaseBoardInfo(res, BaseBoardBasicInfo::SerialNumber))
        std::cout << "主板序列号: " << res << std::endl;

    if (hard_ware.GetBaseBoardInfo(res, BaseBoardBasicInfo::Product))
        std::cout << "主板产品型号: " << res << std::endl;

    if (hard_ware.GetBaseBoardInfo(res, BaseBoardBasicInfo::Version))
        std::cout << "主板版本号: " << res << std::endl;

    if (hard_ware.GetBaseBoardInfo(res, BaseBoardBasicInfo::Manufacturer))
        std::cout << "主板制造商: " << res << std::endl;

    std::cout << "-----------------------------------------------------" << std::endl;

    // BISO信息
    std::cout << "-----------------------------------------------------" << std::endl;

    if (hard_ware.GetBIOSInfo(res, BIOSBasicInfo::SerialNumber))
        std::cout << "BIOS序列号: " << res << std::endl;

    if (hard_ware.GetBIOSInfo(res, BIOSBasicInfo::Version))
        std::cout << "BIOS版本号: " << res << std::endl;

    if (hard_ware.GetBIOSInfo(res, BIOSBasicInfo::Caption))
        std::cout << "BIOS的简短描述: " << res << std::endl;

    if (hard_ware.GetBIOSInfo(res, BIOSBasicInfo::Name))
        std::cout << "BIOS的名称: " << res << std::endl;

    if (hard_ware.GetBIOSInfo(res, BIOSBasicInfo::Manufacturer))
        std::cout << "BIOS的制造商: " << res << std::endl;

    if (hard_ware.GetBIOSInfo(res, BIOSBasicInfo::ReleaseDate))
        std::cout << "BIOS的发布日期: " << res << std::endl;

    if (hard_ware.GetBIOSInfo(res, BIOSBasicInfo::SMBIOSMajorVersion))
        std::cout << "BIOS的主版本号: " << res << std::endl;

    if (hard_ware.GetBIOSInfo(res, BIOSBasicInfo::SMBIOSMinorVersion))
        std::cout << "BIOS的次版本号: " << res << std::endl;

    if (hard_ware.GetBIOSInfo(res, BIOSBasicInfo::CurrentLanguage))
        std::cout << "BIOS的当前语言: " << res << std::endl;
    
    std::cout << "-----------------------------------------------------" << std::endl;

    // 磁盘信息
    std::cout << "-----------------------------------------------------" << std::endl;

    if (hard_ware.GetDiskDriveInfo(res, DiskDriveBasicInfo::SerialNumber))
        std::cout << "磁盘序列号: " << res << std::endl;

    if (hard_ware.GetDiskDriveInfo(res, DiskDriveBasicInfo::Model))
        std::cout << "磁盘驱动器型号: " << res << std::endl;

    if (hard_ware.GetDiskDriveInfo(res, DiskDriveBasicInfo::Size))
        std::cout << "磁盘容量: " << res << std::endl;

    std::cout << "-----------------------------------------------------" << std::endl;

    // CPU信息
    std::cout << "-----------------------------------------------------" << std::endl;

    if (hard_ware.GetProcessorInfo(res, ProcessorBasicInfo::Name))
        std::cout << "CPU名称: " << res << std::endl;

    if (hard_ware.GetProcessorInfo(res, ProcessorBasicInfo::Manufacturer))
        std::cout << "CPU制造商: " << res << std::endl;

    if (hard_ware.GetProcessorInfo(res, ProcessorBasicInfo::NumberOfCores))
        std::cout << "CPU的物理核心数量: " << res << std::endl;

    if (hard_ware.GetProcessorInfo(res, ProcessorBasicInfo::NumberOfLogicalProcessors))
        std::cout << "CPU的逻辑处理器数量: " << res << std::endl;

    if (hard_ware.GetProcessorInfo(res, ProcessorBasicInfo::MaxClockSpeed))
        std::cout << "CPU的最大时钟速度: " << res << std::endl;

    if (hard_ware.GetProcessorInfo(res, ProcessorBasicInfo::ProcessorId))
        std::cout << "CPU的ID: " << res << std::endl;

    if (hard_ware.GetProcessorInfo(res, ProcessorBasicInfo::L2CacheSize))
        std::cout << "CPU的2级缓存大小: " << res << std::endl;

    if (hard_ware.GetProcessorInfo(res, ProcessorBasicInfo::L3CacheSize))
        std::cout << "CPU的3级缓存大小: " << res << std::endl;

    std::cout << "-----------------------------------------------------" << std::endl;

    system("pause");

    return 0;
}